// 手绘风格
import { _random } from "../math/index.js"
import { polarPoints } from './polar.js'
import { _traversal } from "./traversal.js"
export const _offset = (p, offset = 5) => {
    return p.map(t => {
        return t + _random(-offset, offset)
    })
}

export const roughPoints = (options) => {

    let points = polarPoints(options)

    let matrix = []
    let loop = true
    let iter = ([t, next]) => {
        matrix.push([_offset(t), _offset(next)])
        matrix.push([_offset(t), _offset(next)])
    }

    _traversal({ points, loop, iter })

    return matrix
}

